import request from "@/utils/request";

//查询角色列表
export function roleList(data) {
  return request({
    url: "/sys/role/list",
    method: "post",
    data,
  });
}

// 获取当前角色的权限菜单
export function menusList(id) {
  return request({
    url: `/sys/role/menus/${id}`,
    method: "get",
  });
}
//新增角色 or 修改角色 
export function saveAndUpdate(data) {
  return request({
    url: "/sys/role/saveAndUpdate",
    method: "post",
    data
  });
}

//删除角色
export function deleteRole(data) {
  return request({
    url: "/sys/role/delete",
    method: "post",
    data,
  });
}

//更新角色权限信息
export function updataMenus({ data, id }) {
  return request({
    url: `/sys/role/updateMenus/${id}`,
    method: "post",
    data
  });
}
